package com.lc.service;

import com.lc.mapper.CarMapper;
import com.lc.pojo.Car;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CarServiceImpl implements CarService{
    @Autowired
    CarMapper carMapper;
    @Override
    public boolean updateCar(Car car){
        int flag = 0;
        try {
            flag = carMapper.updateCar(car);
        } catch (Exception e) {
            return false;
        }
        if (flag == 1) {
            return true;
        } else {
            return false;
        }
    }
    @Override
    public boolean addCar(Car car){
        int flag = 0;
        try {
            flag = carMapper.addCar(car);
        } catch (Exception e) {
            return false;
        }
        if (flag == 1) {
            return true;
        } else {
            return false;
        }
    }
}
